<?php 

	$tour_name    		 = $this->formText('name', $this->Item['name'], array('class'=>'txtlong'));
	$options      		 = array('Inactive','Active');
	$status       		 = $this->formRadio('status',$this->Item['status'],null,$options, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp");
	
	$order        		 = $this->formText('order',$this->Item['order'],array('class'=>'txtsort'));
	
	$options      		 = array('Khách đoàn', 'Khách lẻ');
	$type         		 = $this->formRadio('type',$this->Item['type'],null,$options, "&nbsp;&nbsp");
	
	$cost                = $this->formText('cost', $this->Item['cost'], array('class'=>'txtsort'));
	
	$options      		 = $this->locationStart;
	$locate_start 		 = $this->formText('location_start',$this->Item['location_start'],array('class'=>'txtmedium'));

	$options      		 = $this->locationEnd;
	$locate_end   		 = $this->formText('location_end',$this->Item['location_end'],array('class'=>'txtmedium'));
	
	$time_limit   		 = $this->formText('time_limit', $this->Item['time_limit'],array('class'=>'txtmedium'));
	
	$time_available      = $this->formText('time_available', $this->Item['time_available'],array('class'=>'txtmedium'));
	
	$options      		 = $this->categorySelect;
	$category      		 = $this->formSelect('tour_category_id', $this->Item['tour_category_id'],null, $options);
	
	$options             = $this->contactSelect;
	$contact             = $this->formSelect('contact', $this->Item['contact'][0]['id'],null, $options);
	
	$date_start_apply    = $this->myDateBox('time_start_apply', 'time_start_apply',  $this->Item['time_start_apply'], array('class'=>'txtsort', 'readonly' => 'readonly'));
	
	$date_end_apply      = $this->myDateBox('time_end_apply', 'time_end_apply', $this->Item['time_end_apply'] ,array('class'=>'txtsort', 'readonly' => 'readonly'));
	
	$date_start_register = $this->myDateBox('time_start_register', 'time_start_register', $this->Item['time_start_register'] ,array('class'=>'txtsort', 'readonly' => 'readonly'));
	
	$date_end_register   = $this->myDateBox('time_end_register', 'time_end_register', $this->Item['time_end_register'], array('class'=>'txtsort', 'readonly' => 'readonly'));
	
	$image               = $this->formFile('picture_tour');
	$imageUrl            = $this->Item['image'];
	
	$medium              = $this->formText('medium', $this->Item['medium'], array('class'=>'txtmedium'));
	
	$options             = $this->hotelSelect;
	$hotel               = $this->formSelect('hotel_iso', $this->Item['hotel_iso'],null, $options);
	
	$view                = $this->formText('view', $this->Item['view'], array('class'=>'txtsort'));
	

	$timeTableTitle      = $this->formText('time_table_title', $this->data['time_table_title'], array('class'=>'txtlong', 'id' => 'timetabletitle'));
	$linkBtn             = $this->baseUrl($this->currentController . '/editor/type/timetable/task/delete/id/' . $this->idTimetable);
	$btnTimeDelete       = $this->formButton('time_delete','Delete',array('onclick'=>"submitEditor('" . $linkBtn . "', 'timetable')"));
	$linkBtn             = $this->baseUrl($this->currentController . '/editor/type/timetable/task/go/id/' . $this->idTimetable);
	$btnTimeGo           = $this->formButton('time_Go','Go',array('onclick'=>"submitEditor('" . $linkBtn . "', 'timetable')"));
	$linkBtn             = $this->baseUrl($this->currentController . '/editor/type/timetable/task/back/id/' . $this->idTimetable);
	$btnTimePreview      = $this->formButton('time_preview ','Preview',array('onclick'=>"submitEditor('" . $linkBtn . "', 'timetable')"));
	$strBtntime          = $btnTimeDelete . ' ' . $btnTimePreview . ' ' . $btnTimeGo;
	
	$noticeTitle         = $this->formText('notice_title', $this->data['notice_title'], array('class'=>'txtmedium', 'id' => 'noticetitle'));
	$linkBtn             = $this->baseUrl($this->currentController . '/editor/type/notice/task/delete/id/' . $this->idNotice);
	$btnNoticeDelete     = $this->formButton('notice_delete','Delete',array('onclick'=>"submitEditor('" . $linkBtn . "', 'notice')"));
	$linkBtn             = $this->baseUrl($this->currentController . '/editor/type/notice/task/go/id/' . $this->idNotice);
	$btnNoticeGo         = $this->formButton('notice_Go','Go',array('onclick'=>"submitEditor('" . $linkBtn . "',  'notice')"));
	$linkBtn             = $this->baseUrl($this->currentController . '/editor/type/notice/task/back/id/' . $this->idNotice);
	$btnNoticePreview    = $this->formButton('notice_preview ','Preview',array('onclick'=>"submitEditor('" . $linkBtn . "',  'notice')"));
	$strBtnNotice        = $btnNoticeDelete . ' ' . $btnNoticePreview . ' ' . $btnNoticeGo;
	 
	$timetableIcon       = '<a href = "#" onclick = "changeDisplay(\'timetable\')">
								<img src = "' . $this->imgUrl . '/icon/arrow_up.png" id = "timetableImg">
								Time table
							</a>';
	
	$noticeIcon          = '<a href = "#" onclick = "changeDisplay(\'notice\')">
								<img src = "' . $this->imgUrl . '/icon/arrow_up.png" id = "noticeImg">
								Notice
							</a>';
	
	$descriptionIcon     = '<a href = "#" onclick = "changeDisplay(\'description\')">
								<img src = "' . $this->imgUrl . '/icon/arrow_up.png" id = "descriptionImg">
								Description
							</a>';
	
	// form errors
	if(count($this->messageError)>0){
		$errors = $this->formErrors($this->messageError,array('id'=>'errors'));
	}
?>
<script type="text/javascript">
    function changeDisplay(id){
       var imgLink = $('#' + id + 'Img').attr('src');
       if(imgLink == '/sunny/public/templates/admin/main/images/icon/arrow_up.png') {
    	   imgLink = '/sunny/public/templates/admin/main/images/icon/arrow_down.png';
       }else {
    	   imgLink = '/sunny/public/templates/admin/main/images/icon/arrow_up.png';
       }
       $('div#' + id + 'info').slideToggle();
       $('#' + id + 'Img').attr("src",imgLink);
    } 
</script>
<form id = 'appForm' name="appForm" method="post" action="" enctype="multipart/form-data">



                        <?php echo $this->render('admin-tour-category/toolbar/index.php')?>
                        <div class="clr"></div>
                         <?php echo $this->render('admin-tour-category/sublink/index.php')?>
                         <?php echo $errors?>
                        <!-- BEGIN: CONTENT -->
                        <div id="element-box">
                            <div class="t">
                                <div class="t">
                                    <div class="t"></div>
                                </div>
                            </div>
                            <div class="m">
                                <!-- BEGIN: ELEMENT BOX -->
						<div id="adminfieldset">
                             <div class="adminheader">Detail</div>
                             <div id = 'adminfieldsetcontent' >
						     <div id = 'adminfieldsetleft'>
								<div id="row">
                                    <div class="label">Tour name:</div>
                                    <?php echo $tour_name;?>			
                                </div>
                                <div class="clr"></div>
                                                      
                                 <div id="row">
                                    <div class="label">Time limit:</div>
                                    <?php echo $time_limit;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Time available:</div>
                                    <?php echo $time_available;?>			
                                </div>
                                <div class="clr"></div>
                                
                                  <div id="row">
                                    <div class="label">Medium:</div>
                                    <?php echo $medium;?>			
                                </div>
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label"> Cost:</div>
                                    <?php echo $cost;?>			
                                </div>
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label">Ordering:</div>
                                    <?php echo $order;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Status:</div>
                                    <?php echo $status;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Type:</div>
                                    <?php echo $type;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Location start:</div>
                                    <?php echo $locate_start;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Location end:</div>
                                    <?php echo $locate_end;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">Category:</div>
                                    <?php echo $category;?>			
                                </div>
                                
                                
                                 <div id="row">
                                    <div class="label">Hotel:</div>
                                    <?php echo $hotel;?>			
                                </div>
                                
                                <div id="row">
                                    <div class="label">Contact:</div>
                                    <?php echo $contact;?>			
                                </div>
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label">Date start apply:</div>
                                    <?php echo $date_start_apply;?>			
                                </div>
                                <div class="clr"></div>
                                
                                  <div id="row">
                                    <div class="label">Date end apply:</div>
                                    <?php echo $date_end_apply;?>			
                                </div>
                                <div class="clr"></div>
                                
                                  <div id="row">
                                    <div class="label">Date start register:</div>
                                    <?php echo $date_start_register;?>			
                                </div>
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label">Date end register:</div>
                                    <?php echo $date_end_register;?>			
                                </div>
                                <div class="clr"></div>
                                
                                 <div id="row">
                                    <div class="label">View:</div>
                                    <?php echo $view;?>			
                                </div>
                                <div class="clr"></div>
                                
                                <div id="row">
                                    <div class="label">Image:</div>
                                    <img src = "<?php echo $this->fileUrl . '/tour_picture/large/' . $imageUrl; ?>" width = "130" height = "110">
                                    <?php echo $image; ?>
                                 </div>
                                <div class="clr"></div>
                                
                              </div>
                              <div id = 'adminfieldsetright'>
                            <div class = 'tetra' id = "timetable">
                              <div class="adminheader"><?php echo $timetableIcon; ?></div>
                               <div id = "timetableinfo" style="display: none">
                                <div id="row">
                                    <div class="label">Title:</div>
                                    <?php echo $timeTableTitle;?>			
                                </div>
                                
                                 <div id="row">
                                    <?php $this->myEditor('timetable', $this->data['time_table'], array('toolbar' => 'MyToolbar'),  $width = '100%', $height = '250');?>			
                                </div>
                                
                                 <div id="row">
                                  
                                   <?php echo $strBtntime;?>
                                  			
                                </div>
                                
                                <div class="clr"></div>
                                </div>
                              </div>
                              
                               <div class = 'tetra' id = "notice">
                               <div class="adminheader"><?php echo $noticeIcon; ?></div>
                                <div id = "noticeinfo" style="display: none">
                                <div id="row">
                                    <div class="label">Title:</div>
                                    <?php echo $noticeTitle;?>			
                                </div>
                                
                                <div id="row">
                                     
                                     <?php $this->myEditor('notice', $this->data['notice'], array('toolbar' => 'MyToolbar'),  $width = '100%', $height = '250');?>
                                     			
                                </div>
                                
                                <div id="row">
                                   <?php echo $strBtnNotice;?>			
                                </div>
                                
                                <div class="clr"></div>
                                </div>
                              </div>
                              
                               <div class = 'tetra' id = "description">
                               <div class="adminheader"><?php echo $descriptionIcon; ?></div>
                                <div id = "descriptioninfo" style="display: none">
                               <div id="row">
                                    
                                     <?php $this->myEditor('description', $this->Item['description'], array('toolbar' => 'MyToolbar'),  $width = '100%', $height = '250');?>
                                     		
                                </div>
                                
                                <div class="clr"></div>
                                </div>
                              </div>
                              
                              </div> 
                              </div> 
                              <div class="clr"></div> 
							</div>
							
                                <!-- END: ELEMENT BOX -->	
                              <div class="clr"></div>
                            </div>
                            <div class="b">
                                <div class="b">
                                    <div class="b"></div>
                                </div>
                            </div>
                        </div>
                        <!-- END: 	CONTENT -->
                        
                        
                    </form>